﻿using System;
using System.Collections.Generic;
using System.Linq;
using Widgetsphere.Autos.Websitev2.Objects;
using Widgetsphere.Autos.API.FacetedNavigation;
using Widgetsphere.WebUtils;
using Widgetsphere.AutoAggregate.Website.Objects;
using HP.Datastore.Common;

namespace Widgetsphere.Autos.Websitev2
{
    public partial class Default : BasePage
    {
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.MyMaster.AllowHeader = false;
            this.MyMaster.AllowFooter = false;

            this.Populate();

            this.Page.Title = "New car pictures, prices and comparisons - TheCarPal";
            this.MetaTagDescription = "See new car pictures, find out new car prices and read new car reviews on Yahoo! Autos. Compare cars and get a free price quote from dealers near you. Check out Kelley Blue Book values for used cars and find used car listings near you.";
            this.MetaTagKeywords = "cars, auto, autos, car, kelley blue book, kelly blue book, auto insurance, car insurance, kbb, car reviews, car pictures, used car prices, new car prices, blue book, compare cars, auto show, car shows, car search, car ratings, car safety, yahoo autos, buy a car, build a car, auto warranty, auto loans, auto loan calculator, car specs, auto insurance quotes, car models";

        }

        private void Populate()
        {
            try
            {
                //MakeDimensionControl1.Populate(RepositoryHelper.MasterResults.AllDimensions.MakeDimension, false);
                StateDimensionControl1.Populate(RepositoryHelper.MasterResults.AllDimensions.StateDimension, false);

                MetroDimensionControl1.ItemsPerRow = 3;
                MetroDimensionControl1.MaxItems = 75;
                MetroDimensionControl1.Populate(RepositoryHelper.MasterResults.AllDimensions.MetroDimension, true);
                //lblTotalResults.Text = RepositoryHelper.MasterResults.TotalRecordCount.ToString("###,###,###,##0") + " cars listed and counting!";
            }
            catch (Exception ex)
            {
                //throw;
            }
        }

    }
}